<template>
  <div>
    <el-tabs v-model="activeName">

      <el-tab-pane name="first">
        <div slot="label" @click="myResignationClick">发送的申请</div>
        <my-resignation ref="myResignation"></my-resignation>
      </el-tab-pane>

      <el-tab-pane name="second">
        <div slot="label" @click="recieveResignationClick">接收的申请</div>
        <recieve-resignation ref="recieveResignation"></recieve-resignation>
      </el-tab-pane>

    </el-tabs>
  </div>
</template>
<script>
  import MyResignation from './module/resignation/send-resignation'
  import RecieveResignation from './module/resignation/receive-resignation'
  export default {
    data() {
      return {
        activeName: 'first'
      }
    },
    components: {
      MyResignation,
      RecieveResignation
    },
    activated() {
      this.myResignationClick()
    },
    methods: {
      myResignationClick() {
        this.$nextTick(() => {
          this.$refs.myResignation.getDataList()
        })
      },
      recieveResignationClick() {
        this.$nextTick(() => {
          this.$refs.recieveResignation.getDataList()
        })
      }
    }
  }
</script>